#!/usr/bin/python3
# -*- coding: utf8 -*-
# Date   : 2021/06/26
# Author : Kwan
# Email  : allenxian@live.com
# Blog   : https://my.oschina.net/u/4173440

from .define import CarParkConfig, Struct, PermissionsModule, admin_required, permission_required, manager_required, AxiosMessage
from .logger import create_logger


# 数据库日志
db_logger = create_logger('logs/carpark/db.log', 'db')
# 应用日志
app_logger = create_logger('logs/carpark/app.log', 'app')
# 硬件设备日志
dev_logger = create_logger('logs/carpark/dev.log', 'dev')
# 连接通讯日志
conn_logger = create_logger('logs/carpark/conn.log', 'conn')
# 操作日志
page_logger = create_logger('logs/carpark/page.log', 'page')



class CarParkDefine:
    # 闸机类型
    GateTypes = {'Entrance':'入口', 'Exit':'出口'}
    # 闸机功能
    GateMethods = {'LicensePlate':'車牌識別','Ticket':'時租票','Card':'月租卡','Temp':'溫度檢測'}
    # 车型
    VehicleTypes = {'Car': '私家車', 'Moto': '電單車'}
    # 车位类型
    ParkingTypes = {'Hourly': '時租車位','Monthly': '月租車位', 'Private':'專用車位'}
    # 停车类型
    ParkingMethods = {'LicensePlate': '車牌識別','Ticket': '時租票','Card': '月租卡'}
    # 工作日
    WorkDays = [
            {"id":1,"name":'星期一'},{"id":2,"name":'星期二'},{"id":3,"name":'星期三'},
            {"id":4,"name":'星期四'},{"id":5,"name":'星期五'},{"id":6,"name":'星期六'},{"id":7,"name":'星期日'}
          ]
    # 月租类型
    MemberParkingTypes = {"Monthly":"月租車位","Private":"專用車位"}
    MemberUserEnable = {True:"啓用",False:"停用"}
    # 支付类型
    PayMents = {
        "Cash":"現金支付","UnionPay":"銀聯支付","MacauPay":"澳門通","AliPay":"支付寶","WeChatPay":"微信支付","MPay":"MPay"
    }
    # 收费类型
    ChargeTypes = {'Hourly': '時租','Monthly': '月租'}
    # 起杆类型
    UpBarMethods = {'Manual': '人工操作','LicensePlate': '車牌糾正'}
    # 闸杆操作
    GateBarMethods = {'Up':'起杆','Down':'落杆'}
    # 车场模式
    CarParkModels = {'Standard':'標準模式','Test':'測試模式'}


class DataDefine:
    # 闸口
    GateTypes = [
        {"id":1,"name":"入口"},
        {"id":2,"name":"出"}
    ]
    # 车型
    VehicleTypes = [
        {"id":1,"name":"電單車"},
        {"id":2,"name":"私家車"}
    ]
    # 通过类型
    ParkingTypes = [
        {"id":1,"name":"時租"},
        {"id":2,"name":"月租"},
        {"id":3,"name":"專用"}
    ]
    # 停车方式
    ParkingMethods = [
        {"id":1,"name":"車牌識別"},
        {"id":2,"name":"時租票"},
        {"id":4,"name":"月租卡"},
        {"id":8,"name":"測試模式"}
    ]